package org.xin.common;


import java.io.IOException;

/**
 * @author ：xin
 * @date ：Created in 2021/9/29
 * @desc <p>  </p>
 * @modified By：$
 * @version: $
 */
public class GlableRun {


    public static void print(String port) {
        System.out.println("\n\t----------------------------------------------------------\n\t" +
                        "Application Boot is running! Access URLs:\n\t" +
                        "Stater Address: \n\t" +
                        "\thttp://"+ "localhost" +':' + port + "/\n\t" +
//                "\thttp://"+ InetAddress.getLocalHost().getHostAddress() +':' + port  + "/\n\t" +
                        "----------------------------------------------------------"
        );
    }
    public static void start(String port){
        print(port);
        try {
            Runtime.getRuntime().exec("cmd /c start " + "http://localhost:" + port);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
